#include<bits/stdc++.h>
using namespace std;
int n;
long long ans;
int main() {
 cin>>n;
 while(n--) {
   int w, s; cin>>w>>s;
   ans += 1LL*w*s;
 }
 cout<<max(0LL, ans)<<endl;
}